<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阻止事件冒泡实例</title>
    <style>
        *{margin: 0;padding: 0;list-style-type: none;}
        .alert{
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
            background-color: #0d060662;
        }
        .content{
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
            background-color: #c98787c8;
            width: 400px;
            height: 300px;
        }
        .btn{
            position: absolute;
            right: 0;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="alert" v-show="bool">
            <div class="content">
                <div class="btn" @click="bool = false">X</div>
                <div class="c"></div>
            </div>
        </div>
        <button @click="bool = true">点击开启/关闭</button>
    </div>
    <script src="../vue2.js"></script>
    <script>
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    num: 0,
                    bool:false
                }
            },
            methons:{

            }
        })
    </script>
</body>
</html>